//
//  AesEncryptor.swift
//  
//


import Foundation

public class AesEncrypt {
    
    /// Return a encrypted string.
    ///
    /// - Parameter key: AES key, size 128bit
    /// - Returns: A encrypted string.
    public func encrypt(plainTxt: String, key: String, iv: String) -> String {
        return AesEncryptor.encryptString(plainTxt, withKey: key, withIv: iv)
    }
    
    /// Return a decrypted string.
    ///
    /// - Parameter key: AES key, size 128bit
    /// - Returns: A decrypted string.
    public func decrypt(encryptStr: String, key: String, iv: String) -> String {
        // 加密时 私钥需要是PKCS8
        return AesEncryptor.decryptString(encryptStr, withKey: key, withIv: iv)
    }

    
}


